//
//  ZMdistrictViewController.m
//  DaMei
//
//  Created by mac on 16/2/23.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ZMdistrictViewController.h"
#import "ZMChangeCityViewController.h"
#import "ZMNavigationController.h"
#import "ZMDropdownView.h"

@interface ZMdistrictViewController ()
- (IBAction)changeCityBtnClick;

@end

@implementation ZMdistrictViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    ZMDropdownView *dropdownView = [ZMDropdownView dropdownView];
    
    
    dropdownView.districtArray = self.districtArray;
    dropdownView.y = 44;
    self.preferredContentSize = CGSizeMake(dropdownView.width, dropdownView.height - 44);
    [self.view addSubview: dropdownView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)changeCityBtnClick {
    
    [self dismissViewControllerAnimated:YES completion:nil];
    
    ZMChangeCityViewController *changeCityVC = [[ZMChangeCityViewController alloc] init];
    ZMNavigationController *nav = [[ZMNavigationController alloc] initWithRootViewController:changeCityVC];
    
    nav.modalPresentationStyle = UIModalPresentationFormSheet;
    nav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:nav animated:YES completion:nil];
    
}
@end
